package com.zdlee.netty.server19.client.console;

import com.zdlee.netty.server19.protocol.request.GroupMessageRequestPacket;
import io.netty.channel.Channel;

import java.util.Scanner;

/**
 * @author zdlee
 * @description: ${DESCRIPTION}
 * @create 2018-12-03 16:41
 */
public class SendToGroupConsoleCommand implements  ConsoleCommand{
    @Override
    public void exec(Scanner sc, Channel channel) {
        System.out.println("发送消息给某个群组: ");

        String toGroupId=sc.next();
        String message=sc.next();
        channel.writeAndFlush(new GroupMessageRequestPacket(toGroupId,message));

    }
}
